<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业2</title>
    <script type="text/javascript">
        function delParagraph() {
            all = document.getElementById("city").childNodes;
            document.getElementById("city").removeChild(all[all.length -1]);
            }
    </script>
</head>
<body>
    <div>
        <p style="color:#00f">旅游城市：</p>
        <ul id="city">
            <li id="BeiJing">北京</li>
            <li>上海</li>
            <li>重庆</li>
            <li id="ChengDou">成都</li>
            <li>天津</li>
            <li>广州</li>
            <li>昆明</li>
        </ul>  
    </div>
    <input type="button" value="删除节点" onclick="delParagraph();"/>
</body>
</html>